// by Xeno
private ["_vehicle"];
#include "x_setup.sqf"

#define __Poss _poss = x_sm_pos select 0;
#define __PossAndOther _poss = x_sm_pos select 0;_pos_other = x_sm_pos select 1;

x_sm_pos = [[2616.62,3539.44,0], [2567.47,3545.69,0]]; // index: 10,   Artillery at top of mount Vysota
x_sm_type = "normal"; // "convoy"

#ifdef __SMMISSIONS_MARKER__
if (true) exitWith {};
#endif

if (X_Client) then {
	d_current_mission_text = "There is a mortar battery at an enemey barracks. Destroy it before enemy troops use it to attack our main assault force.";
	d_current_mission_resolved_text = "Good job. The mortar was destroyed.";
};

if (isServer) then {
	_xarti = switch (d_enemy_side) do {
		case "EAST": {"2b14_82mm"};
		case "WEST": {"M119"};
		case "GUER": {"D30_CDF"};
	};
	__PossAndOther
	_vehicle = objNull;
	_vehicle = _xarti createvehicle (_poss);
	allunits_add set [count allunits_add, _vehicle];
	#ifndef __TT__
	_vehicle addEventHandler ["killed", {_this call XKilledSMTargetNormal}];
	#endif
	#ifdef __TT__
	_vehicle addEventHandler ["killed", {_this call XKilledSMTargetTT}];
	#endif
	_vehicle lock true;
	sleep 2.21;
	["specops", 4, "basic", 2, _poss,100] spawn XCreateInf;
	sleep 2.045;
	["uaz_grenade", 1, "brdm", 1, "uaz_mg", 1, _pos_other,1,100] spawn XCreateArmor;
};

if (true) exitWith {};